﻿using Expect.Core.Interfaces;

namespace Expect.Core.Fixtures
{
    /// <summary>
    /// Fixture for descriptions
    /// </summary>
    public class DescriptionFixture : AbstractFixture
    {
        /// <summary>
        /// Execute the fixture for the provided row
        /// </summary>
        public override bool? RunRow()
        {
            Row.Status.Success = true;
            foreach (var cell in Row)
            {
                cell.Status.Success = true;
            }
            return true;
        }

        /// <summary>
        /// As this is a description, it must always resolve successfully
        /// </summary>
        public override void EndRun()
        {
            this.Fixture.Status.Success = true;

            foreach (var row in Fixture)
            {
                row.Status.Success = true;
                foreach (var cell in row)
                {
                    cell.Status.Success = true;
                }
            }
        }
    }
}
